package com.hitechbangla.fctu.form;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.*;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
 import javax.swing.JPanel;

/**
 * A complete Java class to demonstrate the use of a JScrollPane.
 * 
 * @author alvin alexander, devdaily.com.
 *
 */
public class addmaps
{
  public static void main(String[] args)
  {
    new addmaps();
    //design korte hobe
  }
  
  public addmaps()
  {
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
          JPanel panel = new JPanel();
          JPanel panel1=new JPanel();
          JPanel panel2=new JPanel();
      //    JFrame frame=new JFrame();
           JFrame frame = new JFrame("Add Map");
           
          // frame.setClosable(true);
           
          panel.setLayout(new javax.swing.BoxLayout(panel, javax.swing.BoxLayout.Y_AXIS));
          
          JCheckBox ch1= new JCheckBox("ch1");
          JCheckBox ch2= new JCheckBox("ch1");
          JCheckBox ch3= new JCheckBox("ch1");
          JCheckBox ch4= new JCheckBox("ch1");
          JCheckBox ch5= new JCheckBox("ch1");
          JCheckBox ch6= new JCheckBox("ch1");
          JCheckBox ch7= new JCheckBox("ch1");
         
          /*
          JRadioButton b1=new JRadioButton("b1");
          JRadioButton b2=new JRadioButton("b2");
          JRadioButton b3=new JRadioButton("b3");
          JRadioButton b4=new JRadioButton("b4");
          JRadioButton b5=new JRadioButton("b5");
          JRadioButton b6=new JRadioButton("b1");
          JRadioButton b7=new JRadioButton("b2");
          JRadioButton b8=new JRadioButton("b3");
          JRadioButton b9=new JRadioButton("b4");
          JRadioButton b10=new JRadioButton("b5");
          */
          
       //   JButton bt1=new JButton("OK");
  
          panel.add(ch1);
          panel.add(ch2);
          panel.add(ch3);
          panel.add(ch4);
          panel.add(ch5);           
          panel.add(ch6);
          panel.add(ch7);
         
          
         //panel2.add(panel);
          frame.add(panel,BorderLayout.NORTH);
      //   bt1.setBounds(10,10,100,25);
     //     panel.add(bt1, BorderLayout.CENTER);
          //panel.add(bt1);
         // panel.add(bt1,BorderLayout.CENTER);
          
          JButton button = new JButton("OK");
          button.setAlignmentX(
          Component.CENTER_ALIGNMENT);
         // panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
          //panel.add(Box.createVerticalGlue());
          panel1.add(button);
         // panel1.add(Box.createVerticalGlue());  
          
       //   panel2.add(panel1);
          frame.add(panel1,BorderLayout.SOUTH);
      
        
           
           //panel.add(panel1);
          
          
        // create a jtextarea
        JTextArea textArea = new JTextArea();
        
        // add text to it; we want to make it scroll
        textArea.setText("xx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\nxx\n");
        
        // create a scrollpane, givin it the textarea as a constructor argument
        JScrollPane scrollPane = new JScrollPane(panel);

        // now add the scrollpane to the jframe's content pane, specifically
        // placing it in the center of the jframe's borderlayout
    //    JFrame frame = new JFrame("JScrollPane Test");
        frame.getContentPane().add(scrollPane, BorderLayout.CENTER);

        // make it easy to close the application
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        // set the frame size (you'll usually want to call frame.pack())
        frame.setSize(new Dimension(240, 180));
        
        // center the frame
        frame.setLocationRelativeTo(null);
        
        // make it visible to the user
        frame.setVisible(true);
      }
    });
  }
}